<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>@ViewBag.Title</title>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/ckeditor/ckeditor.js"></script>
<link rel="Stylesheet" type="text/css"
	href='${pageContext.request.contextPath}/Content/blogManager.css' />

<style type="text/css">
#info {
	margin: 10px;
}

#info a {
	text-decoration: none;
}

#info h3 {
	text-indent: 3em;
	background: url('Content/images/ihome-main-bg.gif') repeat-x;
	padding: 5px 0px;
	margin: 10px 0px;
}

#info table {
	margin: 20px;
}

#info td {
	padding-bottom: 7px;
}

input[type="submit"] {
	width: 71px;
	height: 25px;
	background-image: url("Content/images/ihome-header-navBg.gif");
}
</style>
</head>
<body>
	<div id="wrapper">
		<s:action name="backHeader" namespace="/" executeResult="true"></s:action>
		<div id="content">
			<s:action name="backSidebar" namespace="/" executeResult="true"></s:action>
			<div id="main">
				<div id="info">
					<h3>
						<c:if test="${articleId > 0 }">
							修改博文
						</c:if>
						<c:if test="${articleId < 1 }">
							新增博文
						</c:if>
					</h3>
					<form action="edit" method="post">
						<input type="hidden" value="${articleId }" name="articleId" /> 
						<input type="hidden" value="0" name="article.clicks" /> 
						<input type="hidden" value="0" name="article.commentTimes" />
						<table>
							<tr>
								<td style="width: 70px;">标题：</td>
								<td><input type="text" name="article.title"
									value="${article.title }" /></td>
							</tr>
							<tr>
								<td>分类：</td>
								<td><select name="cid">
										<c:forEach items="${categoryList }" var="c">
											<option value="${c.id }">${c.name }</option>
										</c:forEach>
								</select></td>
							</tr>
							<tr>
								<td>内容：</td>
								<td><textarea name="article.content">${article.content }</textarea>
									<script type="text/javascript">
										CKEDITOR.replace('article.content')
									</script></td>
							</tr>
							<tr>
								<td>发表：</td>
								<td><c:if test="${empty check }">
										<input type="checkbox" name="state" />
									</c:if> <c:if test="${not empty check }">
										<input type="checkbox" name="state" checked="checked" />
									</c:if></td>
							</tr>
							<tr>
								<td colspan="2"><input type="submit" value="保存" /></td>
							</tr>
						</table>
					</form>
					<s:fielderror />
				</div>
			</div>
			<div class="clearBoth"></div>
		</div>
		<%@include file="../shared/footer.jsp"%>

	</div>
</body>
</html>